package com.jasiri.project.adapter

import android.view.View
import androidx.recyclerview.widget.RecyclerView
import com.jasiri.project.R
import com.jasiri.lib.baseadapter.JasiriRecyclerViewAdapter
import com.jasiri.lib.baseadapter.JasiriViewHolderHelper
import org.json.JSONObject

/**
 * Sikadwa
 * @Author wwdeng
 * @CreateTime: 2024/4/19 17:24
 * @Annotation：权限类型适配器
 */
class PermissionAdapter (recyclerView: RecyclerView?) : JasiriRecyclerViewAdapter<JSONObject>(recyclerView, R.layout.item_permission_reason_child) {

    override fun setItemChildListener(helper: JasiriViewHolderHelper, viewType: Int) {
        helper.setItemChildClickListener(R.id.itemLayout) //点击Item
    }

    override fun fillData(helper: JasiriViewHolderHelper, position: Int, model: JSONObject) {
        helper.setText(R.id.tvTitle,model.optString("title"))
        helper.setVisibility(R.id.tvTitle, View.GONE)
        helper.setText(R.id.tvDes,model.optString("des"))
    }
}